/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86136
 * Date: 2024-05-28
 * Time: 15:20
 */
class Swap {
    public int num;
}
public class Test {

    public static void swap(Swap swap1,Swap swap2) {
        int tmp = swap1.num;
        swap1.num = swap2.num;
        swap2.num = tmp;
    }
    public static void main4(String[] args) {
        Swap swap1 = new Swap();
        Swap swap2 = new Swap();
        swap1.num = 2;
        swap2.num = 3;
        System.out.println("交换前：swap1.num = " + swap1.num + " swap2.num = " + swap2.num);
        swap(swap1,swap2);
        System.out.println("交换后：swap1.num = " + swap1.num + " swap2.num = " + swap2.num);

    }
}
